enable asnotracking in asp.net core at global level

167

enable asnotracking in asp.net core at global level -

If you have additional settings (e.g. connection string), then the DbContextOptions helps. 
  For example: 
var dbContextOptionsBuilder = new DbContextOptionsBuilder<BloggingContext>()
  .UseSqlServer("SQL connection to Blogging database").
  UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);

Comments

Submit
0 Comments